package com.yes_iot.controller;

import com.yes_iot.config.RegisterException;
import com.yes_iot.entity.LargeScreenConfiguration;
import com.yes_iot.entity.LargeScreenMoudle;
import com.yes_iot.service.*;
import com.yes_iot.service.impl.LargeScreenConfigurationServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
public class BaseController {

    @Autowired
    protected VisualDisplayService visualDisplayService;

    @Autowired
    protected VisualMoudleService visualMoudleService;

    @Autowired
    protected VisualMoudleLibraryService visualMoudleLibraryService;

    @Autowired
    protected LargeScreenConfigurationService largeScreenConfigurationService;
    @Autowired
    protected LargeScreenMoudleService largeScreenMoudleService;

    protected void checkNotNull(String field, Object value) throws RegisterException {
        boolean empty = ObjectUtils.isEmpty(value);
        if (empty){
            throw new RegisterException(field+"的参数不能为空");
        }
    }
}
